% My personal macros. Local to this document.
%\def\unix{Un$\star$x}
%\def\unices{Un$\star$ces}
\def\unix{UNIX}
\def\unices{Unices}
\def\prompt{\$}
\def\ttsym#1{\texttt{\symbol{#1}}}
\def\dqt{\ttsym{34}}	% "
\def\car{\ttsym{94}}	% ^
\def\tld{\ttsym{126}}	% ~

% A set of compatibility macros for layout.
% Right now, they implemented LDP style.
% \def\map#1{\texttt{#1}}    	% NIS map (make this = file)
% \def\lib#1{\texttt{#1}}	    	% library (ditto)
% \def\file#1{\texttt{#1}}	% file name
% \def\prog#1{\texttt{#1}}	% command name
% \def\host#1{\texttt{#1}}      	% host name
% \def\func#1{\texttt{#1}}	% function name (C)
% \def\user#1{\texttt{#1}}	% login name
% \def\email#1{\texttt{#1}}	% email addr
% \def\ngrp#1{\texttt{#1}}	% newsgroup
% \def\option#1{\texttt{#1}}  	% command line option
% \def\message#1{\texttt{#1}}   	% terminal output
% \def\term#1{\texttt{#1}}	% terminal I/O
% \def\addr#1{\texttt{#1}} 	% hardware address etc.
% \def\keyword#1{\texttt{#1}}   	% keyword
% \def\mhdr#1{\texttt{#1}}      	% mail message header field
% \def\var#1{\texttt{\textsl{#1}}}% <insert foobar here> type of things
% \def\shellvar#1{\small\texttt{#1}} % Shell variables.

% This is the ORA style, supposedly:
\def\map#1{\textit{#1}}    	% NIS map (make this = file)
\def\lib#1{\textit{#1}}	    	% library (ditto)
\def\file#1{\textit{#1}}	% file name
\def\prog#1{\textit{#1}}	% command name
\def\host#1{\textbf{#1}}      	% host name
\def\func#1{\textit{#1}}	% function name (C)
\def\user#1{\textbf{#1}}	% login name
\def\email#1{\textbf{#1}}	% email addr
\def\ngrp#1{\textbf{#1}}	% newsgroup
\def\option#1{\texttt{#1}}  	% command line option
\def\message#1{\texttt{#1}}   	% terminal output
\def\term#1{\texttt{#1}}	% terminal I/O
\def\addr#1{\texttt{#1}} 	% hardware address etc.
\def\keyword#1{\textit{#1}}   	% keyword
\def\mhdr#1{\texttt{#1}}      	% mail message header field
\def\var#1{\texttt{\textsl{#1}}}% <insert foobar here> type of things
\def\shellvar#1{\small\texttt{#1}} % Shell variables.

% Named references
% \def\namedlabel#1{\label{#1}}

% This is for \footnote{}\footnote{}. If you don't
% insert anything inbetween, indices 12 and 13 will appear as 1213.
% If you put a space inbetween, you might have an intermittent newline.
% Therefore, I use this symbol.
\def\fnsep{${}^{\mbox{\tiny,}}$}

%
% The following is copied from book.sty. It is used for
% preamble sections like "Contents", "List of Figures",
% etc. I use it for the "List of Abbreviations"
\def\prechapter#1{\chapter*{#1}%
  \addcontentsline{toc}{chapter}{#1}%
  \markboth{\textbf{#1}}{\textbf{#1}}
}
\def\postchapter#1{\prechapter{#1}}
\def\presection#1{\section*{#1}%
  \addcontentsline{toc}{section}{#1}%
  \markboth{\textbf{#1}}{\textbf{#1}}
}
\def\postsection#1{\presection{#1}}
\def\presubsection#1{\subsection*{#1}%
  \addcontentsline{toc}{subsection}{#1}%
  \markboth{\textbf{#1}}{\textbf{#1}}
}
\def\postsubsection#1{\presubsection{#1}}

%
% The following is another annotated bibiliography environment.
% It takes a tag and a shorthand name as its first two arguments;
% the remaining five have the same meaning as in the abib environment.
% It formats the entry differently from abib, plus it allows you to refer
% to it from the text using \cite{tag}, which will produce [name].
%
% The display is not yet beautiful, but....
%
% Its syntax is
% \begin{acbib}{tag}{shorthand}{title}{author}{publ,year}{ISBN}{price}
%	abstract
% \end{acbib}
%
% If ISBN or price are empty, they will be ignored.
%
% This is neither very elegant, nor is it very beautiful. Maybe I'll write
% myself a BiBTeX style someday.... 
\def\@acbiblbl#1{[#1]}
\newenvironment{acbib}[7]%
 {\write\@auxout{\string\bibcite{#1}{#2}}
  \begin{list}%
  {}% no text if no optional argument to \item
  {\topsep 4 ex
   \itemsep .1 ex
   \labelwidth 1 in
   \labelsep 0.2 in
   \leftmargin 1.2 in
   \rightmargin 0 in
   \parsep .5 ex
   \listparindent 0 in
   \let\makelabel\parlabel}
  \item [\textbf{\@acbiblbl{#2}}] \noindent {#4}: \emph{#3}. {#5}.
  \ifx\empty#6\else ISBN {#6}. \fi
  \ifx\empty#7\else Appr.~Price: {#7}\fi

  \smallskip}%
  {\end{list}}

\ifps\else
%
% The following was ripped from transfig output. It is used in
% conjunction with FIG pictures in LaTeX.
\typeout{TransFig: figures in eepic.}

\begingroup\makeatletter
% extract first six characters in \fmtname
\def\x#1#2#3#4#5#6#7\relax{\def\x{#1#2#3#4#5#6}}
\expandafter\x\fmtname xxxxxx\relax \def\y{splain}
\ifx\x\y   % LaTeX or SliTeX?
\gdef\SetFigFont#1#2#3{%
  \ifnum #1<17 \tiny\else \ifnum #1<20 \small\else
  \ifnum #1<24 \normalsize\else \ifnum #1<29 \large\else
  \ifnum #1<34 \Large\else \ifnum #1<41 \LARGE\else
     \huge\fi\fi\fi\fi\fi\fi
  \csname #3\endcsname}
\else
\gdef\SetFigFont#1#2#3{\begingroup
  \count@#1\relax \ifnum 25<\count@ \count@25 \fi
  \def\x{\endgroup\@setsize\SetFigFont{#2pt}}%
  \expandafter\x
    \csname \romannumeral\the\count@ pt\expandafter\endcsname
    \csname @\romannumeral\the\count@ pt\endcsname
  \csname #3\endcsname}
\fi
\endgroup
\fi

%% By kind permission of Matt Welsh:
%% --- moved to linuxdoc.sty
%% The following is for the \namedlabel command. This command inserts a 
%% ``named'' label in the .aux file (whereas normal ``label'' command 
%% uses only the current section number). This allows you to do named
%% cross-references. 
%%
%% Usage: \namedlabel{label-name}{the-label-string}
%% Ex: 
%%     \chapter{Installing Linux}
%%     \namedlabel{chap-install}{Installing Linux}
%%     ...
%%     Please refer to section ``\ref{chap-install}'' on page
%%     \pageref{chap-install}. 
%%
%% It is completely compatible with \ref, \pageref, and other label commands.
%% This is here primarily because the Nutshell books do not use section 
%% numbers.

%\def\namedlabel#1#2{\@bsphack\if@filesw {\let\thepage\relax
%   \def\protect{\noexpand\noexpand\noexpand}%
%   \edef\@tempa{\write\@auxout{\string
%      \newlabel{#1}{{#2}{\thepage}}}}%
%   \expandafter}\@tempa
%   \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
